/*********************************************************************
*
* File: brick.h
* Create Brick
* Author: 10520418 Bui Huu Hiep
*
**********************************************************************/
#pragma once
#ifndef _BRICK_H
#define _BRICK_H
#pragma warning( disable : 4305)
#include "GameObject.h"

#define PI 3.14f

// Velcity y when move up
#define VEL_Y 300

// Velocity when break
#define BRICK_V_AX 400
#define BRICK_V_BX 200
#define BRICK_V_AY 750
#define BRICK_V_BY 500


/********************************************
*
* Brick
* Inheritance form class Obj
* Create Brick
*
********************************************/
class Brick : public GameObject
{
private:

	// Position and velecity of 4 small brick
	float		_Ax;		// Position Ax
	float		_Ay;		// Position Ay
	float		_Bx;		// Position Bx
	float		_By;		// Position	By

	float		_Ax1;		// Position Ax1, Ay1 = Ay
	float		_Bx1;		// Position Bx1, By1 = By

	float		_vel_Ax;	// Velocity Ax
	float		_vel_Bx;	// Velocity Bx
	float		_vel_Ay;	// Velocity Ay
	float		_vel_By;	// Velocity By

	float		_vel_Ax1;	// Velocity Ax1, Ay1 = Ay
	float		_vel_Bx1;	// Velocity Bx1, By1 = By

	float		_acc_y_break; // Acceleration of 4 small brick
	float		_angle;		// Rotation angle
public:
	Brick(float posX, float posY, float width, float height, Resources* res, int number, int depth);
	~Brick(void);

	void Update(float time, QNode* &Tree);
	void Render(LPD3DXSPRITE spriteHandler, Viewport* viewport);
	void ChangeState(char state);
};
#endif

